/*
 * test.cpp
 *
 *  Created on: 2008-12-18
 *      Author: Administrator
 */
#include<iostream>
#include<stdlib.h>
#include"BST.h"
using std::cout;
using std::endl;

int main(void)
{
	srand((unsigned)time(NULL));
	int blues[9];
	BinarySearchTree<int> apple[9];
	for(int i=0; i<9; i++)
	{
		blues[i] = (int)((double)rand()/((double)(RAND_MAX)+(double)(1))*100) + 1;
		apple[i].SetRoot(blues[i]);
	}
	apple[0].CreateTree(apple[1], apple[2]);
	apple[2].CreateTree(apple[3], apple[4]);
	apple[3].CreateTree(apple[5], apple[6]);
	apple[6].CreateTree(apple[7], apple[8]);
	bool found = apple[0].BST_Search(10);
	cout<<found<<endl;
	apple[0].BST_Insert(15);
	apple[0].PreOrder();
	cout<<endl;
	apple[0].BST_Insert(25);
	apple[0].PreOrder();

	return 0;
}
